Fix otelconf prometheus label escaping#8763
Merged
dmathieu merged 6 commits intoopen-telemetry:mainfrom Apr 3, 2026
Merged
Conversation
underscores
When both without_type_suffix and without_units are set (which is the
default config for the OTel Collector), prometheusReaderOpts was
selecting
UnderscoreEscapingWithoutSuffixes as the translation strategy. This
strategy
sets LabelNamer{UTF8Allowed: false}, converting OTel dot-style label
names
(e.g. service.name) to underscore-style (service_name) in target_info
and
on all metric datapoints.
Fix by using NoTranslation instead, which preserves dot-style label
names
(ShouldEscape()=false) and suppresses metric name suffixes
(ShouldAddSuffixes()=false).
Related issue:
open-telemetry/opentelemetry-collector-contrib#47011
Signed-off-by: alex boten <223565+codeboten@users.noreply.github.com>
codeboten
commented
Apr 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8763 +/- ##
=====================================
Coverage 83.5% 83.5%
=====================================
Files 192 192
Lines 15578 15578
=====================================
Hits 13015 13015
Misses 2116 2116
Partials 447 447
🚀 New features to boost your workflow:
|
XSAM
approved these changes
Apr 2, 2026
dmathieu
approved these changes
Apr 3, 2026
Member
|
Merging this without the 24h wait, so we can get the fix into the upcoming release. |
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I couldn't push to the original PR #8696, this is the same as @dmitryax's original PR with the addition of a fix for 0.2.0 and applied the suggestion from @XSAM